<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JavaScript 消息框</title>
    <script>
        var t;
        function alt() {
            console.log("弹弹")
            t = setTimeout(alt, 1000)
        }

        function f() {
            clearTimeout(t)
        }

        setTimeout(f, 5000)
        alt()

        // alert("1.hello \n2.world \n3.world")
        function submit_() {
            let ret = confirm('你真的要提交！');
            return ret;
        }

        function test() {
            var choice = prompt("请你输入您的选择\n1.表示登录\n2.表示注册", "编号")

            if (choice == null) {
                test()
            } else if (choice == "1") {
                document.write("来登录")
            } else if (choice == "2") {
                document.write("注册啦")
            } else {
                document.write("啥都没有")
            }
        }

    </script>
</head>
<body>
    <button onclick="test()"> 点击</button>
    <form action="https://www.baidu.com" method="get">
        <input type="submit" value="提交" onclick="return confirm('你真的要提交！')">
    </form>
</body>
</html>